/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testsql;

import java.sql.*;
/**
 *
 * @author lamagat
 */
public class requete {
    public requete(){
        String url = "jdbc:mysql://localhost/Compteur";
        Connection con;
        String query = "INSERT INTO uniteProduction(Nom, tel, mail, ville) values ('ugo', 053532, 'fgfg', 'albi');";
        Statement stmt;
        try {
            Driver mySQLDriver = new org.gjt.mm.mysql.Driver();
            con = DriverManager.getConnection(url, "root", "");
            System.out.println("Con = " + con);
            stmt = con.createStatement();
        stmt.executeUpdate(query);
        stmt.close(); 
        con.close();
            
        }catch (SQLException ex){
          System.err.println("SQLexception: " + ex.getMessage()); 
        }
        
    }
    public static void main(String args[])
    {
        requete query = new requete();
    }
}
